package com.gujiayue.common.encrypt;

import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Component;

/**
 * 自定义的密码加密方法，实现了PasswordEncoder接口
 *
 */
@Component
public class MyPasswordEncoder implements PasswordEncoder {

	@Override
	public String encode(CharSequence charSequence) {
		System.out.println("--->>>"+charSequence.toString());
		// 加密方法可以根据自己的需要修改
		return charSequence.toString();
	}

	@Override
	public boolean matches(CharSequence charSequence, String s) {
		System.out.println("--->>>"+charSequence.toString());
		System.out.println("--->>>"+s);
		return encode(charSequence).equals(s);
	}
}